<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      "use strict";

      var scores = [20, 81, 75, 40, 91, 59, 77, 66, 72, 88, 99];
      var groups = _.groupBy(scores, function (x) {
        if (x < 60) {
          return "C";
        } else if (x < 80) {
          return "B";
        } else {
          return "A";
        }
      });
      console.log(groups);
    </script>
  </body>
</html>
